home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 November
/
Chip_2004-11_cd1.bin
/
zkuste
/
dolby
/
download
/
dvdlab
/
DVDlabProRC2b.exe
/
{app}
/
Extras
/
Script
/
Link Bitmap.talk
< prev
next >
Wrap
Text File
|
2004-03-22
|
2KB
|
60 lines
/* Link Bitmap 1.0
by Oscar, 12 Dec 2003
To run this: DROP the Script from Assets to the Object in Menu.
This example replace the selected object with the bitmap image of the object it links to
For example if a button links to Movie it will be replaced by the frame from the movie
if it links to a menu, it will be replaced by a current snapshot of that menu
Note: because of the bitmap merging, the text will become not-editable after you apply this
*/
// Get the current menu and selected object when you drag and drop script
// Note: if testing from Script editor make sure you have just one menu opened on desktop,
// in such case the MenuGetCurSel will return currently opened menu
menu = MenuGetCurSel()
// VTS menu 1..255, VMG menu 10001..10255
// show the current menu on top of all others
MenuActivate(menu)
object= ObjectGetCurSel(menu)
if (object==0) then
print "No object Selected"
end
endif
// where the object links to ?
nMenu = ObjectGetMenuLink(menu,object) // 0-if no menu link
nMovie = ObjectGetMovieLink(menu,object) // 0-if no movie link
nChapter = ObjectGetChapterLink(menu,object) // 0- Movie start
trace "Menu ",nMenu," Movie ",nMovie," Chapter=",nChapter
if nMenu>0 then
// we link to menu !!
// grab the menu snapshot
ImgGrabMenuFrame(1,nMenu)
nW= ImgGetWidth(1)
nH= ImgGetHeight(1)
// don't keep the whole menu in its original size
ImgResize(1,nW/2,nH/2)
ImgSetToObject(1,menu,object)
endif
if (nMovie>0) then
// we link to a movie
//grab a frame from the movie
ImgGrabChapterFrame(1,nMovie,nChapter) //nChapter = 0 ->Movie start
ImgSetToObject(1,menu,object)
endif
// no menu link and no movie link - it is just as good as nothing
if (nMovie==0 & nMenu==0) then
print "The object doesn't link to anything"
endif